export default{
	wexinPay(data, resolve, reject) {
		console.log(data)
		WeixinJSBridge.invoke(
			'getBrandWCPayRequest', {
				"appId":data.appId, //公众号名称，由商户传入
				"timeStamp": data.timeStamp, //时间戳     
				"nonceStr": data.nonceStr, //随机串     
				"package": data.package,
				"signType": data.signType, //微信签名方式：     
				"paySign": data.paySign //微信签名 
			},
			function(res) {
				console.log(res)
				if (res.err_msg == "get_brand_wcpay_request:ok") {
					resolve({
						msg: '支付成功',
						status: 1
					})
				} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
					resolve({
						msg: '已取消支付',
						status: 2
					})
				} else {
					resolve({
						msg: '支付失败',
						status: 3
					})
				}
			}
		);
	}
	
}
